using System;
using System.Data.Entity.ModelConfiguration;
using System.Data.Common;
using System.Data.Entity;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using DomainLayer.Data.Entities;

namespace Infrastructure.Data.Mapping
{
	public class PMS_PermissionRuleMap : EntityTypeConfiguration<PMS_PermissionRule>
	{
		public PMS_PermissionRuleMap()
		{
			// Primary Key
			this.HasKey(t => t.RuleId);

			// Properties
			this.Property(t => t.RuleName)
				.HasMaxLength(50);
				
			this.Property(t => t.RuleKey)
				.HasMaxLength(200);
				
			this.Property(t => t.RuleValue)
				.HasMaxLength(200);
				
			this.Property(t => t.RuleTypeKey)
				.HasMaxLength(50);
				
			this.Property(t => t.SubSysKey)
				.HasMaxLength(50);
				
			this.Property(t => t.RuleDescription)
				.HasMaxLength(200);
				
			// Table & Column Mappings
			this.ToTable("PMS_PermissionRule");
			this.Property(t => t.RuleId).HasColumnName("RuleId");
			this.Property(t => t.RuleName).HasColumnName("RuleName");
			this.Property(t => t.RuleKey).HasColumnName("RuleKey");
			this.Property(t => t.RuleValue).HasColumnName("RuleValue");
			this.Property(t => t.RuleTypeKey).HasColumnName("RuleTypeKey");
			this.Property(t => t.PermissionType).HasColumnName("PermissionType");
			this.Property(t => t.SubSysKey).HasColumnName("SubSysKey");
			this.Property(t => t.RuleDescription).HasColumnName("RuleDescription");
			this.Property(t => t.IsDelete).HasColumnName("IsDelete");
			this.Property(t => t.CreatBy).HasColumnName("CreatBy");
			this.Property(t => t.CreateTime).HasColumnName("CreateTime");
			this.Property(t => t.UpdateBy).HasColumnName("UpdateBy");
			this.Property(t => t.UpdateTime).HasColumnName("UpdateTime");
		}
	}
}

